home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / screen.swg / 0059_Asm Retrace.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-01-27  |  1.0 KB  |  33 lines

  1. {
  2. >> add a WAIT procedure in your program to wait for the
  3. >> vertical retrace then your image will slide smoothly
  4.  
  5. > I thought this was only a problem with CGA cards .. is that still
  6. > true?
  7.  
  8. >> It's no longer a PROBLEM per se. It doesn't cause snow anymore, but you
  9. >> still get a jitter/flicker problem if you move an image
  10. >> without waiting for retrace. Problem is that the memory
  11. >> gets updated while the retrace is halfway down the
  12.  
  13. > Where can I get source for such a wait procedure? Do you or JB? have
  14. > one?
  15. }
  16. var
  17.  addr6845:word absolute $40:$63; {bios's crtc ptr}
  18.   {CRT Controller=+0}
  19.   {CRT Status=+6}
  20.   {Mode Control=+4}
  21.  
  22. procedure syncRetrace;assembler;asm
  23.  mov ax,seg addr6845; mov es,ax;
  24.  mov dx,es:[addr6845]; add dx,6; {find crt status reg}
  25.  {@LOOP1: in al,dx; test al,8; jnz @LOOP1;}
  26.  @LOOP2: in al,dx; test al,8; jz @LOOP2;
  27.  end;
  28. {
  29. some people like to make sure the current retrace (if any) has ended before
  30. waiting for one to begin. I find it unnecessary in practice. But if you wanna
  31. do that, uncomment LOOP1.
  32. }
  33.